const {createFriend}=require('../dao/dbserver/friend')
const { send } = require('../dao/dbserver/gmessage')
const { creategroup } = require('../dao/dbserver/group')
const {adduser} = require('../dao/dbserver/member')
const msg = require('../dao/dbserver/message')

exports.addFriend = (req,res,next)=>{
    var {uid,fid,msg} = req.body
    createFriend(uid,fid,msg,res)
}
exports.addGroup = (req,res,next)=>{
    creategroup(req.body,res)
}
exports.addmember = (req,res,next)=>{
    var {gid,userlist} = req.body
    adduser(gid,userlist,res)
}

exports.addmessage = (req,res,next)=>{
    var obj = req.body
   console.log(obj);
    msg.send(obj,res)
}

exports.addgmsg = (req,res,next)=>{ 
    var obj = req.body
    send(obj,res)
}